package Dao.Impl;

import Dao.MainTypeDao;
import Domain.MainType;
import Domain.Product;
import JDBCUtils.JDBCUtils;
import Service.Impl.MainTypeServiceImpl;
import Service.Impl.ProductServiceImpl;
import Service.MainTypeService;
import Service.ProductService;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;

import java.util.HashMap;
import java.util.List;

public class MainTypeDaoImpl implements MainTypeDao {
    private JdbcTemplate template = new JdbcTemplate(JDBCUtils.getDataSource());
    @Override
    public List<MainType> FindALLMainType() {
        String sql ="select * from main_type";
        List<MainType> result = template.query(sql,new BeanPropertyRowMapper<>(MainType.class));
        return result;
    }


}
